package com.weimob.mcloud.wechatwork.customer.service.user.module.enums.group;

import lombok.Getter;

/**
 * @author yuzhaoyang
 * @desc 客户群变更类型
 * @date 2021-02-06 19:30
 */
public enum ChatGroupOperationTypeEnum {
    /**
     * 变更类型 0-新建群 1-群变更 2-群解散
     */
    CREATE((byte) 0, "新建群"),
    UPDATE((byte) 1, "群变更"),
    DISMISS((byte) 2, "群解散"),
    ;

    @Getter
    private byte value;
    @Getter
    private String desc;

    ChatGroupOperationTypeEnum(byte value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static ChatGroupOperationTypeEnum getEnumByValue(byte value) {
        for (ChatGroupOperationTypeEnum typeEnum : ChatGroupOperationTypeEnum.values()) {
            if (value == typeEnum.value) {
                return typeEnum;
            }
        }
        return null;
    }
}
